<template>
  <div ref="permissionPage" class="permission_page">
    <h2>To provide you with our services, we need your consent to collect, process and store your personal information.</h2>
    <dl>
      <dt>SMS</dt>
      <dd>
        MoreGold will retrive information about the SMS stored in your device including message ID, timestamp, phone number, and content. Your SMS information will be uploaded to our data security center, https://plclucky.com/. MoreGold uses this information in its risk analysis models to determine whether you are eligible for MoreGold’s services. We use automated processing to understand your financial activity, and this also helps our fraud models verify your identity. MoreGold will never disclose the contents of your text messages.
      </dd>
      <dt>Location</dt>
      <dd>
        We collect your location information when MoreGold app is running in the foreground so as to verify your identity and auto-fill your address during loan application.We will cease collection of location when app is running in the background.      </dd>
      <dt>Image</dt>
      <dd>
        We will collect the user's image information which includes image name, type, and length during the user's loan process to verify the user's identity for anti-fraud checks and enable the user to upload photos to complete the application form. The collected information will be encrypted and stored at our data security center, https://plclucky.com/, we attach great importance to the security of user information and will never share it with third parties.      </dd>
      <dt>Camera</dt>
      <dd>
        We require the camera permission to provide you an easy/smooth experience and to enable you to click photos of your KYC documents along with other required documents and upload the same on the App during your loan application journey.      </dd>
      <dt>Contacts</dt>
      <dd>
        We collect and upload contacts you selected which includes names, phone numbers and contact relationships from your phone to our data security center,https://plclucky.com/. These data is used to access your risk profile and to determine your loan eligibility. Information is used internally by the system and will not be shared with any third party for use.
      </dd>
      <dt>Installed Applications</dt>
      <dd>
        We collect a list of the installed applications' metadata information which includes the application name, package name, installed time, updated time, version name and version code of each installed application on your device to assess your credit worthiness and enrich your profile with pre-approved customized loan offers.      </dd>
      <!-- <dt>Device information</dt>
      <dd>When you install the application, we will request access to relevant information on your device such as mobile device type / IP address / SSAID / hardware version. /OS version/file directory information (including audio, images, videos, downloaded files, etc.), camera/storage, and IMEI.</dd> -->
      <!-- <dt>Phone Number</dt> -->
      <!-- <dd>Personal phone number for account registration is collected and uploaded from your device to https://magicianapi.Funpera.com by encryption data.The purpose is to verify your identity and protect your data security.</dd> -->
      <dt>Device</dt>
      <dd>
        We collect device information including SSAID, MAC address, IMEI, hardware model, operating system version, etc. from your phone to ensure the safety and legality of users using this product.
      </dd>
    </dl>
  </div>
</template>

<script>
  import env from '@/config/env';
  // import Hybrid from '@/components/uzone-hybrid';

  export default {
    name: 'permission',
    data() {
      return {
        apiUrl: env.apiPrefix,
        gateway: env.apiGateway,
        hasNotice: false,
      };
    },
    methods: {
      noticeBottom() {
        // 通知APP，页面已经滚动到底部，阅读完成，通知一次
        if (!this.hasNotice) {
          this.hasNotice = true;
          // const hybrid = new Hybrid(this.$os.android ? 'android' : 'ios');
          this.$hybrid.action('scrollBottom', {scrollBottom: true});
        }
      },
    },
    mounted() {
      const page = this.$refs.permissionPage;
      const winHeight = window.innerHeight;
      const scrollTop = document.scrollingElement.scrollTop;
      if (scrollTop + winHeight + 20 >= page.clientHeight) {
        this.noticeBottom();
      }
      window.addEventListener('scroll', () => {
        const scrollTop = document.scrollingElement.scrollTop;
        if (scrollTop + winHeight + 20 >= page.clientHeight) {
          this.noticeBottom();
        }
      });
    }
  };
</script>

<style lang="scss" scoped>
  @import "~@/assets/scss/function.scss";

  .permission_page {
    padding: 30px;

    h2 {
      font-size: 36px;
      font-weight: bold;
      margin: 0 0 40px;
      line-height: 1.5em;
      text-align: center;
    }

    dl {
      dt {
        font-weight: bold;
        font-size: 32px;
      }

      dd {
        margin-bottom: 30px;
        color: #666;
      }

      .red_color {
        color: $red;
      }

      .center {
        font-size: 28px;
        text-align: center;
        //font-weight: bold;
        color: #666;
      }
    }
  }
</style>
